package com.ashes.brave.controller;


import com.ashes.belife.common.utils.Result;
import com.ashes.brave.service.MenuSysService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author chengxuhui
 */
@Api(tags = "菜单模组开发")
@RestController
@RequestMapping("/ashes/brave")
public class MenuSysController {

    @Autowired
    private MenuSysService menuSysService;

    /**
     * 获取用户权限
     * @param userId
     * @return
     */
    @ApiOperation("获取用户权限")
    @PostMapping("/queryPermsByUserId")
    public Result<List<String>> selectPermsByUserId(BigDecimal userId){
        List<String> permsList =  menuSysService.queryPermsByUserId(userId);
        return Result.ok(permsList);
    }


}
